/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package operator.server;

import java.io.Serializable;
import java.util.Date;

/**
 *
 * @author mire
 */
public class OperatorUser implements Serializable {

    private int id;
    private String number;
    private Date creationTime;
    private String oldOperator;
    private String currentOperator;

    public OperatorUser(String number, String currentOperator) {
        this.number = number;
        this.currentOperator = currentOperator;
        this.oldOperator = currentOperator;
        this.creationTime = new Date();
        id = this.hashCode();
    }

    public OperatorUser(int id, String number, String currentOperator) {
        this.id = id;
        this.number = number;
        this.currentOperator = currentOperator;
        this.oldOperator = currentOperator;
        this.creationTime = new Date();
    }

    public OperatorUser(String number, String oldOperator, String currentOperator) {
        this.number = number;
        this.oldOperator = oldOperator;
        this.currentOperator = currentOperator;
        this.creationTime = new Date();
        id = this.hashCode();
    }

    public OperatorUser(int id, String number, String oldOperator, String currentOperator) {
        this.id = id;
        this.number = number;
        this.oldOperator = oldOperator;
        this.currentOperator = currentOperator;
        this.creationTime = new Date();
    }

    public OperatorUser(int id, String number, Date creationTime, String oldOperator, String currentOperator) {
        this.id = id;
        this.number = number;
        this.creationTime = creationTime;
        this.oldOperator = oldOperator;
        this.currentOperator = currentOperator;
    }

    public Date getCreationTime() {
        return creationTime;
    }

    public String getNumber() {
        return number;
    }

    public int getId() {
        return id;
    }

    public String getCurrentOperator() {
        return currentOperator;
    }

    public String getOldOperator() {
        return oldOperator;
    }

    public void setCurrentOperator(String currentOperator) {
        this.currentOperator = currentOperator;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final OperatorUser other = (OperatorUser) obj;
        if ((this.number == null) ? (other.number != null) : !this.number.equals(other.number)) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 79 * hash + (this.number != null ? this.number.hashCode() : 0);
        hash = 79 * hash + (this.creationTime != null ? this.creationTime.hashCode() : 0);
        hash = 79 * hash + (this.currentOperator != null ? this.currentOperator.hashCode() : 0);
        return hash;
    }

    @Override
    public String toString() {
        return number;
    }
}
